package com.huawei.appmarket.service.store.awk.node;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
import android.widget.LinearLayout;
import com.huawei.appgallery.horizontalcard.api.view.BounceHorizontalRecyclerView;
import com.huawei.appmarket.service.store.awk.card.HorizontalApplistCard;
import com.huawei.appmarket.service.store.awk.widget.horizon.BaseHorizonCard;
import java.util.ArrayList;
import o.azb;
import o.cdr;
import o.cgz;
import o.cht$d;
import o.chy;
import o.chz;
import o.eib;
import o.ewm.h;
import o.ewm.j;

public class HorizontalApplistNode extends cdr {
    private BaseHorizonCard ˊ;

    public HorizontalApplistNode(Context context) {
        super(context, 0);
    }

    public ArrayList<String> z_() {
        if (this.ˊ != null) {
            return this.ˊ.ͺ();
        }
        return null;
    }

    public int ˏ() {
        return eib.ʻॱ();
    }

    public boolean ˊ(ViewGroup viewGroup, ViewGroup viewGroup2) {
        LayoutParams layoutParams = new LinearLayout.LayoutParams(-1, -1);
        layoutParams.weight = 1.0f;
        this.ˊ = new HorizontalApplistCard(this.ॱ);
        LinearLayout linearLayout = (LinearLayout) LayoutInflater.from(this.ॱ).inflate(h.ˋﾞ, null);
        ˊ(linearLayout);
        BounceHorizontalRecyclerView bounceHorizontalRecyclerView = (BounceHorizontalRecyclerView) linearLayout.findViewById(j.ˏ);
        LinearLayout.LayoutParams layoutParams2 = (LinearLayout.LayoutParams) bounceHorizontalRecyclerView.getLayoutParams();
        if (layoutParams2 != null) {
            layoutParams2.topMargin = 0;
            layoutParams2.bottomMargin = 0;
            bounceHorizontalRecyclerView.setLayoutParams(layoutParams2);
        }
        this.ˊ.ˏ((View) linearLayout);
        ˊ(this.ˊ);
        viewGroup.addView(linearLayout, layoutParams);
        return true;
    }

    private void ˊ(LinearLayout linearLayout) {
        azb.ˏ(linearLayout, j.ʿ);
    }

    public boolean ॱ(chz o_chz, ViewGroup viewGroup) {
        if (this.ˊ != null) {
            this.ˊ.ˊ(o_chz, ͺ());
        }
        return super.ॱ(o_chz, viewGroup);
    }

    public void ˋ(chy o_chy) {
        int i = 0;
        while (i < ˊॱ()) {
            cgz ˊ = ˊ(i);
            if (ˊ instanceof HorizontalApplistCard) {
                HorizontalApplistCard horizontalApplistCard = (HorizontalApplistCard) ˊ;
                horizontalApplistCard.ʻॱ().setOnClickListener(new cht$d(o_chy, horizontalApplistCard));
                horizontalApplistCard.ˊ(o_chy);
                i++;
            } else {
                return;
            }
        }
    }

    public boolean ॱ() {
        return true;
    }

    public boolean ʽ() {
        if (this.ˊ != null) {
            return this.ˊ.ॱˊ();
        }
        return false;
    }
}
